package world.ztomorrow.novel.dto.resp;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Builder;
import lombok.Data;
import world.ztomorrow.common.dto.UsernameSerializer;

import java.time.LocalDateTime;
import java.util.List;

@Data
@Builder
public class BookCommentRespDto {

    private Long commentTotal;


    private List<CommentInfo> comments;

    @Data
    @Builder
    @ApiModel(description = "评论信息 响应DTO")
    public static class CommentInfo {
        @ApiModelProperty( "评论ID")
        @JsonFormat(shape = JsonFormat.Shape.STRING)
        private Long id;
        @ApiModelProperty( "评论内容")
        private String commentContent;
        @ApiModelProperty( "评论用户")
        @JsonSerialize(using = UsernameSerializer.class)
        private String commentUser;
        @ApiModelProperty( "评论用户ID")
        @JsonFormat(shape = JsonFormat.Shape.STRING)
        private Long commentUserId;
        @ApiModelProperty( "评论用户照片")
        private String commentUserPhoto;
        @ApiModelProperty( "评论时间")
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        private LocalDateTime commentTime;

    }
}
